package com_fit.springboot_fit.repository;


import com_fit.springboot_fit.entity.AdminMenu;
import com_fit.springboot_fit.entity.AdminUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AdminMenuRepository extends JpaRepository<AdminMenu, Integer> {

    // 查询显示的菜单
    List<AdminMenu> findByIsShowOrderBySortAsc(AdminUser.YesNoEnum isShow);

    // 根据父ID查询菜单
    List<AdminMenu> findByPidAndIsShowOrderBySortAsc(Integer pid, AdminUser.YesNoEnum isShow);

    // 根据模块、控制器、动作查询菜单
    AdminMenu findByMAndCAndA(String m, String c, String a);
}
